#include "task_thread.hpp"
#include "C++_pool_thread.hpp"
#include <unistd.h>
#include <string>


int main()
{
    thread_pool<task> pool;
    srand((unsigned int)time(NULL));
    char opt[] ={'+', '-', '*', '/'};
    pool.start();
    while(true)
    {
        int x = rand()%1000;
        int y = rand()%500;
        char op = opt[rand()%4];
        task _task(x, y, op);
        bool push_result = pool.push(_task);
        if (push_result == true) std::cout << "载入数据成功" <<std::endl;
        else std::cout << "载入数据失败" <<std::endl;
        usleep(5000);
    }

    return 0;
}